home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9598 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: news.hungary.net!not-for-mail
  2. From: imed@odin.net (Tamas Dunaszegi)
  3. Newsgroups: comp.lang.c,comp.lang.c++,comp.os.ms-windows.programmer.misc,comp.os.msdos.programmer,comp.programming,comp.windows.ms.programmer
  4. Subject: Re: How to access miliseconds?
  5. Date: 3 Mar 1996 02:20:12 -0000
  6. Organization: ODIN Hungary +36-1-213-2023
  7. Message-ID: <WwjNx8Nc7kSX083yn@odin.net>
  8. References: <4fqh79$j4j@usenet.rpi.edu> <3121E861.3EA8@tid.es>
  9.  <31232CFA.6007@lure.u-psud.fr>
  10. NNTP-Posting-Host: omega.hungary.net
  11.  
  12. In article <31232CFA.6007@lure.u-psud.fr>,
  13. Laurent Pointal <pointal@lure.u-psud.fr> wrote:
  14. >Mariano wrote:
  15. > >
  16. > > You can use :
  17. > >
  18. > >         UINT SetTimer (hwnd, idTimer,uTimeOut, tmprc);
  19. > >
  20. > >         hwnd handle to the window associated with the timer (and with tmprc);
  21. > >         idTimer a nonzero timer identifier.
  22. > >         uTimeOut in mseconds,
  23. > >         tmprc is a pointer to a function to handle the timeouts of the timer.
  24. > >
  25. > >
  26. > >         BOOL KillTimer (hwnd, idTimer); when you finish to use the Timer.
  27. > >
  28. > > --
  29. > > Mariano Garcia Ruiz (mgr@tid.es)
  30. >
  31. >If you get a true millisecond timing resolution with SetTimer, please, email me how you have done
  32. >such a miracle :-).
  33. >Honnestly, SetTimer is right to maintain a clock displaying or things like that, but it has not a
  34. >millisecond precision.
  35. >
  36.  
  37.    You can read a timer with msec resolution using the VTD virtual device
  38. driver.
  39.  
  40.    First you must get the API entry point of tha VxD calling int 2F this way:
  41.  
  42.    asm mov ax, 1684h
  43.    asm mov bx, 5  ; vxd_id
  44.    asm xor di, di
  45.    asm mov es, di
  46.    asm int 2fh
  47.  
  48.    Now you have the entry point in es:di. If you call this with 0101h in ax,
  49. you get back the time since Windows startup in msecs in the eax register.
  50.  
  51.    That's all folks.
  52.  
  53. ---------------------------------------------------------------------------
  54.                                Tamas Dunaszegi
  55.                 8000 Szekesfehervar, Dobsinai u. 4., HUNGARY
  56.                                 imed@odin.net
  57.  
  58.